package com.weme.main.viewmode

import android.util.Log
import com.weme.common.base.BaseViewModel
import com.weme.common.network.NetWorkUrl
import dev.kratos.api.im_server.v1.CancelCallRequest
import dev.kratos.api.user_server.v1.GetCountryListRequest
import dev.kratos.api.user_server.v1.GetGiftListRequest

class MainViewMode : BaseViewModel() {
    fun getCountryList(req: GetCountryListRequest) {
        val reqByte = req.toByteArray()
        sendNetworkRequest(reqByte, NetWorkUrl.GetCountryList)
    }


    fun setCancelCall(channelName: String, uid: Long) {
        Log.e("socket", channelName + "/" + uid)
        sendImNetworkRequest(CancelCallRequest.newBuilder().setChannelName(channelName).setToUid(uid).build().toByteArray(), NetWorkUrl.CancelCall)
    }

    fun getGiftList() {
        sendNetworkRequest(GetGiftListRequest.newBuilder().build().toByteArray(), NetWorkUrl.DownloadGiftMp4)
    }

    fun getGiftListApi(req: GetGiftListRequest) {
        val reqByte = req.toByteArray()
        sendNetworkRequest(reqByte, NetWorkUrl.GetGiftList)
    }
}